<!-- src/Home.vue -->
<template>
  <div class="container">
    <div class="left">
      <el-card class="card student-card" @click="goToStudentLogin">
        <h2>我是学生</h2>
      </el-card>
    </div>
    <div class="right">
      <el-card class="card teacher-card" @click="goToTeacherLogin">
        <h2>我是老师</h2>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goToStudentLogin() {
      this.$router.push('/LoginByEmailForStu'); // 导航到学生登录页面
    },
    goToTeacherLogin() {
      this.$router.push('/LoginByEmailForTea'); // 导航到老师登录页面
    },
  },
};
</script>

<style>
.container {
  display: flex;
  height: 100vh; /* 使容器充满屏幕 */
  justify-content: center;
  align-items: center;
  background-color: #bd4949; /* 设置背景颜色 */
}

.left, .right {
  flex: 1; /* 平分左右两侧 */
  display: flex;
  justify-content: center;
  align-items: center;

}

.card {
  width: 400px; /* 卡片宽度 */

  padding: 20px;
  text-align: center;
  border-radius: 8px; /* 边框圆角 */
  transition: all 0.3s; /* 动画过渡效果 */
  cursor: pointer; /* 鼠标悬停时显示手指 */
}

.student-card {
  background-color: #409eff; /* 学生卡片背景颜色 */
  color: #ffffff; /* 学生卡片字体颜色 */
}

.teacher-card {
  background-color: #67c23a; /* 老师卡片背景颜色 */
  color: #ffffff; /* 老师卡片字体颜色 */
}

.card:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 鼠标悬停时阴影效果 */
}
</style>
